home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / proj21sw / projtest.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-07-18  |  3.6 KB  |  127 lines

  1. VERSION 2.00
  2. Begin Form TestForm 
  3.    Caption         =   "This is a test project for Project Analyzer"
  4.    ClientHeight    =   1080
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   5160
  8.    Height          =   1485
  9.    Icon            =   PROJTEST.FRX:0000
  10.    Left            =   1035
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   1080
  13.    ScaleWidth      =   5160
  14.    Top             =   1140
  15.    Width           =   5280
  16.    Begin DriveListBox Drive1 
  17.       Height          =   315
  18.       Left            =   210
  19.       TabIndex        =   2
  20.       Top             =   630
  21.       Width           =   2535
  22.    End
  23.    Begin CommandButton Quit 
  24.       Caption         =   "Quit"
  25.       Height          =   330
  26.       Left            =   3780
  27.       TabIndex        =   0
  28.       Top             =   630
  29.       Width           =   1275
  30.    End
  31.    Begin Image Image1 
  32.       Height          =   480
  33.       Left            =   4515
  34.       Picture         =   PROJTEST.FRX:0302
  35.       Top             =   45
  36.       Width           =   480
  37.    End
  38.    Begin Label Label1 
  39.       Caption         =   "This program will not do anything"
  40.       Height          =   330
  41.       Left            =   210
  42.       TabIndex        =   1
  43.       Top             =   90
  44.       Width           =   4320
  45.    End
  46. ' ProjTest.Frm - a test project for Project Analyzer
  47. ' (C)1995 MyCompany Ltd.
  48. ' This is the form of the main screen
  49. ' This file also includes some important database routines
  50. DefStr W
  51. Dim DatabaseName As String
  52. Dim DatabaseOpen As Integer
  53. Dim Weekdays(0 To 6)
  54. Const MAX_BUTTONS = 50
  55. Dim FName As String
  56. ' This is a module-level variable that overrides the
  57. ' global variable FName in FILETEST.BAS
  58. Sub CloseDatabase ()
  59. ' Close the database
  60. ' Check that all information is up-to-date
  61. End Sub
  62. Function ExtensionOnly (ByVal File As String) As String
  63. ' Returns file name extension "BAS"
  64. ' This is a module-level function that will override
  65. ' the global function ExtensionOnly defined in FILETEST.BAS
  66. ExtensionOnly = Right(File, 3)
  67. End Function
  68. Function Fibonacci (ByVal n As Integer)
  69. ' Sample of a recursive call sequence
  70. ' This function is only called by SumFibonacci
  71. ' but not by any other procedure
  72. ' -> Fibonacci and SumFibonacci are dead code
  73. If n = 1 Then
  74.     Fibonacci = 1
  75. ElseIf n = 2 Then
  76.     Fibonacci = 1
  77.     Fibonacci = SumFibonacci(n - 1, n - 2)
  78. End If
  79. End Function
  80. Sub Form_Load ()
  81. ' Start of the program
  82. ReadINIFile
  83. OpenDB
  84. RunTheProgram
  85. End Sub
  86. Sub Form_Unload (Cancel As Integer)
  87. ' Quit the program
  88. ' First close the database
  89. CloseDatabase
  90. End Sub
  91. Sub OpenDB ()
  92. ' Opening the DB
  93. ' Check for user rights
  94. ' Lock appropriate tables
  95. If ExtensionOnly(FName) = "TXT" Then
  96.     ' It is a text database
  97. ElseIf IsDir("C:\WINDOWS") Then
  98.     If DriveType("C:", Drive1) <> DRIVE_FIXED Then
  99.         ' Panic
  100.     Else
  101.         ' Don't panic
  102.     End If
  103. End If
  104. End Sub
  105. Sub Quit_Click ()
  106. Unload Me
  107. End Sub
  108. Sub ReadINIFile ()
  109. ' Read the configuration in PROJTEST.INI
  110. ' Note: If PROJTEST.INI doesn't exist, use defaults
  111. IsThere = IsFile("PROJTEST.INI")
  112. End Sub
  113. Sub RunTheProgram ()
  114. ' Run the program only if there is at least 1 MB free
  115. ' disk space
  116. ' Otherwise show error message
  117. If DiskSpaceFree("C:") < 1024 ^ 2 Then
  118. End If
  119. End Sub
  120. Function SumFibonacci (a, b)
  121. ' Sample of a recursive call sequence
  122. ' This function is only called by Fibonacci
  123. ' but not by any other procedure
  124. ' -> Fibonacci and SumFibonacci are dead code
  125. SumFibonacci = Fibonacci(a) + Fibonacci(b)
  126. End Function
  127.